package stanford.com.balldating.chat.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.project.framework.model.JSONModel;

import stanford.com.balldating.chat.service.FriendsService;

@Controller
@RequestMapping("/friend")
public class FriendController {
	@Autowired
	FriendsService service;
	
	@ResponseBody
	@RequestMapping(value="/loadFriends",method=RequestMethod.POST)
	public JSONModel loadFriend(String username){
		JSONModel model=new JSONModel();
		
		model.setSuccess(true);
		
		model.setData(service.loadFriend(username));
		
		return model;
	}
}
